<div class="h">
    <p class="p1">{:L('_NAME')}</p>

    <p class="p2">
        <input type="text" id="mall_name" maxlength="10" class="yanz"
               value="{$phone.name}"/>
    </p>

    <div class="clear"></div>
</div>
<div class="h">
    <p class="p1">{:L('_PHONE')}</p>

    <p class="p2">
        <input type="text" id="mall_phone" maxlength="20" class="yanz"
               value="{$phone.phone}"/>
    </p>

    <div class="clear"></div>
</div>
<div class="h">
    <p class="p1">{:L('_REMARK')}</p>

    <p class="p2">
        <input type="text" id="mall_remark" maxlength="50"
               value="{$phone.remark}"/>
    </p>

    <div class="clear"></div>
</div>
<div class="h">
    <p class="p1">&nbsp;</p>

    <p class="p2">
        <a onclick="phone_do_update()" class="button add"></a> <a
            onclick="closeBox()" class="button qx"></a>
    </p>
</div>

<input type="text" id="mall_pid" value="{$phone.id}"
       style="display: none;"/>
<script type="text/javascript">
    function phone_do_update() {
        var id = $("#mall_pid").val();
        var name = $("#mall_name").val();
        var phone = $("#mall_phone").val();
        var remark = $("#mall_remark").val();

        if (id && name && phone) {
            $.getJSON(setting.app + '/phone/update/' + id + "?name=" + name + "&phone="
                    + phone + "&remark=" + remark, function (data) {
                if (data.status) {
                    $("#phone_" + id + " > #phone_" + id).html(phone);
                    $("#phone_" + id + " > #name_" + id).html(name);
                    closeBox();
                } else {
                    alert(data.data);
                }
            });
        } else {
            alert('修改条件不满足');
        }
    }
</script>